package cn.ultrarisk.scadmin.manager.biz.monitor.entity;

import cn.ultrarisk.mybatis.extension.annotation.Table;

import java.io.Serializable;
import java.util.LinkedHashMap;
import java.util.Map;

/**
 * 错误日志实体类
 *
 * @author sevendlong(lin23871@163.com)
 * @date 2014/4/14
 * @since V1.0
 */
@Table(table = "error_log", idColumn = ErrorLog.ID, autoIncrement = true)
public class ErrorLog implements Serializable {
    private static final long serialVersionUID = -4222366449258551872L;

    public final static String ID = "id";
    public final static String COLLECTION_ID = "collection_id";
    public final static String TARGET = "target";
    public final static String PARAMS = "querys";
    public final static String IP = "ip";
    public final static String MESSAGE = "message";
    public final static String STACK_TRACE = "stack_trace";
    public final static String ERROR_TIME = "error_time";

    public static final Map<String, String> COLUMN_PROPERTY_MAP = new LinkedHashMap<String, String>();

    static {
        COLUMN_PROPERTY_MAP.put(ID, "id");
        COLUMN_PROPERTY_MAP.put(COLLECTION_ID, "collectionId");
        COLUMN_PROPERTY_MAP.put(TARGET, "target");
        COLUMN_PROPERTY_MAP.put(PARAMS, "querys");
        COLUMN_PROPERTY_MAP.put(IP, "ip");
        COLUMN_PROPERTY_MAP.put(MESSAGE, "message");
        COLUMN_PROPERTY_MAP.put(STACK_TRACE, "stackTrace");
        COLUMN_PROPERTY_MAP.put(ERROR_TIME, "errorTime");
    }

    /**
     * id
     */
    private Long id;
    /**
     * 集合id
     */
    private Integer collectionId;
    /**
     * 调用对象
     */
    private String target;
    /**
     * 调用参数
     */
    private String querys;
    /**
     * 来源ip
     */
    private String ip;
    /**
     * 错误信息
     */
    private String message;
    /**
     * 堆栈信息
     */
    private String stackTrace;
    /**
     * 出错时间
     */
    private Long errorTime;

    /**
     * 索引名称
     */
    private String indexName;

    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public Integer getCollectionId() {
        return collectionId;
    }

    public void setCollectionId(Integer collectionId) {
        this.collectionId = collectionId;
    }

    public String getTarget() {
        return target;
    }

    public void setTarget(String target) {
        this.target = target;
    }

    public String getParams() {
        return querys;
    }

    public void setParams(String querys) {
        this.querys = querys;
    }

    public String getIp() {
        return ip;
    }

    public void setIp(String ip) {
        this.ip = ip;
    }

    public Long getErrorTime() {
        return errorTime;
    }

    public void setErrorTime(Long errorTime) {
        this.errorTime = errorTime;
    }

    public String getMessage() {
        return message;
    }

    public void setMessage(String message) {
        this.message = message;
    }

    public String getStackTrace() {
        return stackTrace;
    }

    public void setStackTrace(String stackTrace) {
        this.stackTrace = stackTrace;
    }

    public String getIndexName() {
        return indexName;
    }

    public void setIndexName(String indexName) {
        this.indexName = indexName;
    }
}